package com.shg.admin.controller;

import com.shg.admin.bean.Account;
import com.shg.admin.service.AccountService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/account")
public class AccountController {
    
    private final AccountService accountService;

    public AccountController(AccountService accountService) {
        this.accountService = accountService;
    }
    
    @ResponseBody
    @GetMapping
    public Account getAccountById(@RequestParam("id") Long id){
        return accountService.getAccountById(id);
    }
}
